'\"macro stdmacro
.\"
.\" Copyright (c) 2014-2016,2019 Red Hat.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PCP-IOSTAT 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmiostat\f1,
\f3pcp-iostat\f1 \- report block I/O statistics
.SH SYNOPSIS
\f3pcp\f1 [\f2pcp\ options\f1] \f3iostat\f1
[\f3\-u\f1]
[\f3\-G\f1 \f2method\f1]
[\f3\-P\f1 \f2precision\f1]
[\f3\-R\f1 \f2pattern\f1]
[\f3\-x\f1 [dm][,t][,h][,noidle]\f1]
.SH DESCRIPTION
.B pcp-iostat
reports I/O statistics for SCSI (by default) or other devices (if the \f3\-x\f1 option is specified).
.SH OPTIONS
When invoked via the
.BR pcp (1)
command, the
.BR \-a /\c
.BR \-\-archive ,
.BR \-h /\c
.BR \-\-host ,
.BR \-O /\c
.BR \-\-origin ,
.BR \-s /\c
.BR \-\-samples ,
.BR \-t /\c
.BR \-\-interval ,
.BR \-Z /\c
.BR \-\-timezone
and several other
.I pcp options
become indirectly available; refer to
.BR PCPIntro (1)
for a complete description of these options.
.PP
The additional command line options available for
.B pcp-iostat
are:
.TP 5
\fB\-G \fImethod\fR\fR, \fB\-\-aggregate\fR=\fImethod\fR
Specifies that statistics for device names matching the regular
expression specified with the
.B \-R
.I regex
option should be aggregated according to
.IR method .
Note this is aggregation based on matching device names (not
temporal aggregation).
When
.B \-G
is used,
the device name column is reported as
.IR method (\fIregex\fR),
e.g.
if
.B \-G sum
.B \-R 'sd(a|b)$'
is specified, the device column will be
.BR sum (\fBsd(a|b)$)\fR
and
summed statistics for
.B sda
and
.B sdb
will be reported in the remaining columns.
If
.B \-G
is specified but
.B \-R
is not specified, then the default
.I regex
is
.BR .* ,
i.e. matching all device names.
If
.I method
is
.B sum
then the statistics are summed.
This includes the
.B %util
column, which may therefore exceed 100% if more than one device name matches.
If
.I method
is
.B avg
then the statistics are summed and then averaged by dividing by the
number of matching device names.
If
.I method
is
.B min
or
.BR max ,
the minimum or maximum statistics for matching devices are reported,
respectively.
.TP
\fB\-P\fR \fIN\fR, \fB\-\-precision\fR=\fIN\fR
This indicates the precision (number of decimal places) to report.
The default precision \f2N\f1
may be set to something other than the default (2).
Note that the
.B avgrq-sz
and
.B avgqu-sz
fields are always reported with \f2N\f1+1 decimals of precision.
These fields typically have values less than 1.
.TP
\fB\-R\fR \fIpattern\fR, \fB\-\-regex\fR=\fIpattern\fR
This restricts the report to device names matching a regular expression
.IR pattern .
The given
.I pattern
is searched as a perl style regular expression, and will match any
portion of a device name.
e.g. '^sd[a-zA-Z]+' will match all device names starting with 'sd'
followed by one or more alphabetic characters.
e.g. '^sd(a|b)$' will only match 'sda' and 'sdb'.
e.g. 'sda$' will match 'sda' but not 'sdab'.
See also the
.B \-G
option for aggregation options.
.TP
\fB\-u\fR, \fB\-\-no-interpolation\fR
When replaying a set of archives, by default values are reported
according to the requested sample interval (\c
.B \-t
option), not according to the actual interval recorded in the archive(s).
Without this option PCP interpolates the values to be reported based on the
records in the set of archives, which is particularly useful when the
.B \-t
option is used to replay a set of archives with a longer sampling interval
than that with which the archive(s) was originally recorded with.
With the
.B \-u
option,
uninterpolated reporting is enabled - every value is reported
according to the native recording interval in the set of archives.
When the
.B \-u
option is specified, the
.B \-t
option makes no sense and is incompatible because the replay interval
is always the same as the recording interval in the set of archive.
In addition,
.B \-u
only makes sense when replaying archives, see the
.B \-a
option on
.BR PCPIntro (1),
and so if
.B \-u
is specified then
.B \-a
must also be specified.
.TP
\f3\-x\f1 \f2comma-separated-options\f1
Specifies a comma-separated list of one or more extended reporting
options as follows:
.br
\f3dm\fP - report statistics for device-mapper logical devices instead
of SCSI devices,
.br
\f3t\fP - prefix every line in the report with a timestamp in
\f2ctime\fP(3) format,
.br
\f3h\fP - omit the heading, which is otherwise reported every 24 samples,
.br
\f3noidle\fP - Do not display statistics for idle devices.
.SH REPORT
The columns in the
.B pcp-iostat
report have the following interpretation:
.TP
.B Timestamp
When the \f3\-x t\fP option is specified, this column is the timestamp in
\f3ctime\fP(3) format.
.TP
.B Device
Specifies the scsi device name, or if \f3-x dm\fP is specified,
the device-mapper logical device name.
When
.B \-G
is specified, this is replaced by the aggregation method and
regular expression - see the
.B \-G
and
.B \-R
options above.
.TP
.B rrqm/s
The number of read requests expressed as a rate per-second that were merged
during the reporting interval by the I/O scheduler.
.TP
.B wrqm/s
The number of write requests expressed as a rate per-second that were merged
during the reporting interval by the I/O scheduler.
.TP
.B r/s
The number of read requests completed by the device (after merges),
expressed as a rate per second during the reporting interval.
.TP
.B w/s
The number of write requests completed by the device (after merges),
expressed as a rate per second during the reporting interval.
.TP
.B rkB/s
The average volume of data read from the device expressed as
KBytes/second during the reporting interval.
.TP
.B wkB/s
The average volume of data written to the device expressed as
KBytes/second during the reporting interval.
.TP
.B avgrq-sz
The average I/O request size for both reads and writes to the
device expressed as Kbytes during the reporting interval.
.TP
.B avgqu-sz
The average queue length of read and write requests to the
device during the reporting interval.
.TP
.B await
The average time in milliseconds that read and write requests
were queued (and serviced) to the device during the reporting interval.
.TP
.B r_await
The average time in milliseconds that read requests were queued
(and serviced) to the device during the reporting interval.
.TP
.B w_await
The average time in milliseconds that write requests were queued
(and serviced) to the device during the reporting interval.
.TP
.B %util
The percentage of time during the reporting interval that the
device was busy processing requests.
A value of 100% indicates device saturation.
.SH DIAGNOSTICS
All are generated on standard error and are intended to be self-explanatory.
.SH PCP ENVIRONMENT
Environment variables with the prefix \fBPCP_\fP are used to parameterize
the file and directory names used by PCP.
On each installation, the
file \fI/etc/pcp.conf\fP contains the local values for these variables.
The \fB$PCP_CONF\fP variable may be used to specify an alternative
configuration file, as described in \fBpcp.conf\fP(5).
.PP
For environment variables affecting PCP tools, see \fBpmGetOptions\fP(3).
.SH SEE ALSO
.BR PCPIntro (1),
.BR pcp (1),
.BR iostat2pcp (1),
.BR pmcd (1),
.BR pmchart (1),
.BR pmlogger (1),
.BR pcp.conf (5)
and
.BR pcp.env (5).
